/*******************************
 * Builder for Open and Save
 ***/
/* OpenBuilder */
class OpenBuilder
{
public:
	virtual bool Open() = 0;
	OpenBuilder(PTSTR pstrFileName, Sheet* psheet)
		: pSheet(psheet) 
		{
			ZeroMemory(openFileName, MAX_PATH);
			_tcscpy_s(openFileName, _tcslen(pstrFileName)+1 , pstrFileName);
		}
protected:
	Sheet* pSheet;
	TCHAR openFileName[MAX_PATH];
};

/* SaveBuilder */
class SaveBuilder
{
public:
	virtual bool Save() = 0;
	SaveBuilder(PTSTR pstrFileName, Sheet* psheet)
		: pSheet(psheet) 
		{
			_tcscpy_s(saveFileName,  _tcslen(pstrFileName)+1, pstrFileName);
		}
protected:
	Sheet* pSheet;
	TCHAR saveFileName[MAX_PATH];
};

/*******************************
 * Concrete Open and Save
 ***/
/* Opener - CSV */
class CSVOpener : public OpenBuilder
{
public:
	CSVOpener(PTSTR  FileName, Sheet* psheet)
		: OpenBuilder(FileName,psheet){}
	virtual bool Open();
};

/* Saver - CSV */
class CSVSaver : public SaveBuilder
{
public:
	CSVSaver(PTSTR FileName, Sheet* psheet)
		: SaveBuilder(FileName, psheet) {}
	virtual bool Save();
};